{"ast":null,"code":"import apiClient from \"../http\";\nimport { getChatOrNew, getChats, newMultiChat, deleteChat } from \"../routes\";\nexport default class ChatService {\n  static async getChatsList() {\n    return apiClient.get(getChats());\n  }\n  static async getDialogOrNew(otherUserId) {\n    return apiClient.get(getChatOrNew(otherUserId));\n  }\n  static async getNewMultiDialog(newDialog) {\n    return apiClient.post(newMultiChat(), newDialog);\n  }\n  static async deleteChat(chatId) {\n    console.log(deleteChat(chatId.toString()));\n    return apiClient.delete(deleteChat(chatId.toString()));\n  }\n}","map":{"version":3,"names":["apiClient","getChatOrNew","getChats","newMultiChat","deleteChat","ChatService","getChatsList","get","getDialogOrNew","otherUserId","getNewMultiDialog","newDialog","post","chatId","console","log","toString","delete"],"sources":["/data/messenger.client/src/services/ChatService.ts"],"sourcesContent":["import apiClient from \"../http\";\nimport {AxiosResponse} from 'axios';\nimport {getChatOrNew, getChats, newMultiChat, deleteChat} from \"../routes\"\nimport {ChatsListResponse} from \"../models/response/ChatsListResponse\";\nimport {ChatsListItem} from \"../models/response/ChatsListItem\";\nimport ChatRequest from \"../models/request/ChatRequest\";\nimport {DeleteChatResponse} from \"../models/response/Other/DeleteChatResponse\";\n\nexport default class ChatService {\n    public static async getChatsList(): Promise<AxiosResponse<ChatsListResponse>> {\n        return apiClient.get<ChatsListResponse>(getChats());\n    }\n\n    public static async getDialogOrNew(otherUserId: string): Promise<AxiosResponse<ChatsListItem>> {\n        return apiClient.get<ChatsListItem>(getChatOrNew(otherUserId));\n    }\n\n    public static async getNewMultiDialog(newDialog: ChatRequest): Promise<AxiosResponse<ChatsListItem>> {\n        return apiClient.post<ChatsListItem>(newMultiChat(), newDialog);\n    }\n\n    public static async deleteChat(chatId: string): Promise<AxiosResponse<DeleteChatResponse>> {\n        console.log(deleteChat(chatId.toString()))\n        return apiClient.delete<DeleteChatResponse>(deleteChat(chatId.toString()));\n    }\n}"],"mappings":"AAAA,OAAOA,SAAS,MAAM,SAAS;AAE/B,SAAQC,YAAY,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,UAAU,QAAO,WAAW;AAM1E,eAAe,MAAMC,WAAW,CAAC;EAC7B,aAAoBC,YAAY,GAA8C;IAC1E,OAAON,SAAS,CAACO,GAAG,CAAoBL,QAAQ,EAAE,CAAC;EACvD;EAEA,aAAoBM,cAAc,CAACC,WAAmB,EAAyC;IAC3F,OAAOT,SAAS,CAACO,GAAG,CAAgBN,YAAY,CAACQ,WAAW,CAAC,CAAC;EAClE;EAEA,aAAoBC,iBAAiB,CAACC,SAAsB,EAAyC;IACjG,OAAOX,SAAS,CAACY,IAAI,CAAgBT,YAAY,EAAE,EAAEQ,SAAS,CAAC;EACnE;EAEA,aAAoBP,UAAU,CAACS,MAAc,EAA8C;IACvFC,OAAO,CAACC,GAAG,CAACX,UAAU,CAACS,MAAM,CAACG,QAAQ,EAAE,CAAC,CAAC;IAC1C,OAAOhB,SAAS,CAACiB,MAAM,CAAqBb,UAAU,CAACS,MAAM,CAACG,QAAQ,EAAE,CAAC,CAAC;EAC9E;AACJ"},"metadata":{},"sourceType":"module"}